//
//  ViewController.m
//  ZFBCollectionDemo
//
//  Created by Apple on 2018/3/24.
//  Copyright © 2018年 techbird. All rights reserved.
//

#import "ViewController.h"
#import "ZFBBusinessType.h"
#import "ZFBBusinessTypeView.h"

@interface ViewController()
@property (nonatomic,strong)NSArray *businessTypeData;
@end

@implementation ViewController

- (void)viewDidLoad {
    [self loadBusinessTypeData];
    ZFBBusinessTypeView *businessTypeView = [[ZFBBusinessTypeView alloc]initWithFrame:CGRectMake(0, 20, 375, 180)];
    businessTypeView.businessTypeData = _businessTypeData;
    [self.view addSubview:businessTypeView];
}

#pragma mark - 加载商家分类数据
-(void)loadBusinessTypeData{
    NSArray *dictArr = [NSArray arrayWithContentsOfURL:[[NSBundle mainBundle] URLForResource:@"businessType.plist" withExtension:nil]];
    NSMutableArray *arrM = [NSMutableArray arrayWithCapacity:dictArr.count];
    [dictArr enumerateObjectsUsingBlock:^(id  _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
        [arrM addObject:[ZFBBusinessType businessTypeWithDict:obj]];
    }];
    _businessTypeData = arrM;
}


@end
